package com.hugh.dubbo.service.provider.com.hugh.dubbo.provide.scheduled;

import com.hugh.dubbo.data.BaseDataComputService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author: Hugh
 * @Date: 2020/7/5
 */
@Slf4j
@Component
@Lazy(false)
public class ScheduledTaskImpl extends BaseDataComputService implements ScheduledTaskService{

    @Override
    @Scheduled(fixedRate = 1000*10)
    @Async
    public void execute(){
        getAndComputData();
        computDataTp90();
        computDataTp99();
        log.info("线程 {} 开始统计TP90、TP99的耗时情况",Thread.currentThread().getName());
    }

}
